# .bashrc

## Icons in terminal
source ~/.local/share/icons-in-terminal/icons_bash.sh

## FZF Support
source /usr/share/fzf/completion.bash
source /usr/share/fzf/key-bindings.bash

## Add pass update completions
source /usr/share/bash-completion/completions/pass-update

## Acitivatre vi-mode with <Escape>
set -o vi

## If not running interactively, don't do anything
[[ $- != *i* ]] && return

alias sudo='doas'
alias g='git'
alias ls='eza'
alias la='eza -lag'
alias ll='eza -lg'
alias xi='doas xbps-install'
alias xq='xbps-query'
alias xr='doas xbps-remove'
alias yv='pipe-viewer --api=auto'
alias cp='cp -v'
alias mv='mv -v'
alias rm='rm -iv'
alias v='nvim'
alias vl='NVIM_APPNAME=nvim-lazyvim nvim'
alias L='ls -la'
alias nnn='nnn -eU'
alias cl='clear'
alias grep='grep --color'
alias mbsync="mbsync -c $MBSYNCRC"
alias i="doas xbps-install -S"
alias u="i; doas xbps-install -u xbps; doas xbps-install -u"
alias q="xbps-query -Rs"
alias r="doas xbps-remove -R"
alias tmate='tmate -a ~/.ssh/authorized_keys -f ~/.config/tmate/tmate.conf new-session -s TMATE'
# alias cp='/usr/local/bin/cpg -gv'
# alias mv='/usr/local/bin/mvg -gv'

function cdf() {
	cd "$(find . -type d | fzf)" || exit
}

function vif() {
	vim "$(find . -type f | fzf)" || exit
}

_BLACK=$(tput bold)$(tput setaf 0)
_RED=$(tput bold)$(tput setaf 1)
_GREEN=$(tput bold)$(tput setaf 2)
_YELLOW=$(tput bold)$(tput setaf 3)
_BLUE=$(tput bold)$(tput setaf 4)
_MAGENTA=$(tput bold)$(tput setaf 5)
_CYAN=$(tput bold)$(tput setaf 6)
_WHITE=$(tput bold)$(tput setaf 7)
_RESET=$(tput sgr0)
_BOLD=$(tput bold)
PS1="${_YELLOW}[\h \w]> ${_RESET}"

#PS1='[\u@\h \W]\$ '
#PS1="\[$(tput bold)\]\[$(tput setaf 5)\][\u@\h \W]\\$ \[$(tput sgr0)\]"
# PS1="$(tput bold)$(tput setaf 3)[\h $(tput setaf 2)\w$(tput setaf 3)]> $(tput sgr0)"

# To initialize zoxide, add this to your configuration (usually ~/.bashrc):
eval "$(zoxide init bash)"
